# !/bin/sh
[ $# != "1" ] && echo "Usage: $0 tardir" && exit 0
DESTFILE="$1.run"
echo "# !/bin/sh" > $DESTFILE
echo "tail -n +5 \$0 | tar -xv " >> $DESTFILE
echo "[ -f $1/1.sh ] && cd $1 && chmod +x 1.sh && ./1.sh" >> $DESTFILE
echo "exit 0" >> $DESTFILE
chmod +x $DESTFILE
tar -c $1 >> $DESTFILE
